﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="Default.aspx.cs"
    Inherits="EndPointRegistrationWeb._Default" %>

<html>
<head id="Head1" runat="server">
    <link rel="Stylesheet" href="CSS/Right.css" />
    <title>Cadastro de End-Point</title>

    <script language="javascript">
        function ResetFormForInsert()
        {
            endpointForm.hdnCodigoEndPoint.value = "";
            endpointForm.hdnSelected.value = "";
            //endpointForm.txtModulo.value = "";
            endpointForm.ddlModulo.value = "";
            //endpointForm.txtSubModulo.value = "";
            endpointForm.ddlSubModulo.value = "";
            endpointForm.txtContrato.value = "";
            //endpointForm.txtProtocolo.value = "";
            endpointForm.cmbProtocolo.selectedIndex = 0;
            ifrGrid.ResetGridColor('datagridEndPoints');
            //endpointForm.txtModulo.focus();
            endpointForm.ddlModulo.focus();
        }
        
		function ConfirmDeletion()
		{
			if(confirm("Você tem que certeza que deseja deletar o(s) item(s) selecionado(s)?"))
			{
				endpointForm.hdnDeleteAction.value = "S";
				endpointForm.submit();
			}
		}
    </script>

</head>
<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0">
    <form id="endpointForm" runat="server">
    <input type="hidden" id="hdnDeleteAction" name="hdnDeleteAction" runat="server" />
    <input type="hidden" id="hdnCodigoEndPoint" name="hdnCodigoEndPoint" runat="server" />
    <input type="hidden" id="hdnSelected" name="hdnSelected" runat="server" />
    <table width="100%" height="100%">
        <tr height="1">
            <td>
                <fieldset>
                    <legend>Formulário de Cadastro</legend>
                    <table width="100%" height="100%">
                        <tr valign="middle">
                            <td width="100">
                                Módulo:
                            </td>
                            <td width="*">
                                <!--OnSelectedIndexChanged="ddlModulo_SelectedIndexChanged"  OnTextChanged="ddlModulo_SelectedIndexChanged"-->
                                <asp:DropDownList ID="ddlModulo" runat="server" Width="650" OnSelectedIndexChanged="ddlModulo_SelectedIndexChanged" AutoPostBack="true" />
                            </td>
                        </tr>
                        <tr valign="middle">
                            <td width="100">
                                Sub-Módulo:
                            </td>
                            <td width="*">
                                <asp:DropDownList ID="ddlSubModulo" runat="server" Width="650" 
                                    AutoPostBack="True" />
                            </td>
                        </tr>
                        <tr valign="middle">
                            <td width="100">
                                Contrato:
                            </td>
                            <td width="*">
                                <asp:TextBox ID="txtContrato" runat="server" Width="650" />
                            </td>
                        </tr>
                        <tr valign="middle">
                            <td width="100">
                                Protocolo:
                            </td>
                            <td width="*">
                                <%--<asp:TextBox ID="txtProtocolo" runat="server" Width="650"/>--%>
                                <select runat="server" id="cmbProtocolo">
                                    <option value="Tcp">Tcp</option>
                                    <option value="NamedPipe">NamedPipe</option>
                                    <option value="Http">Http</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="right">
                                <asp:Button ID="btSave" runat="server" Text="Salvar" />
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </td>
        </tr>
        <tr height="1">
            <td>
                <table width="100%" height="100%">
                    <tr valign="top">
                        <td width="1">
                            <asp:Button ID="btDeleteSelected" runat="server" Text="Deletar itens selecionados"
                                Enabled="false" onmousedown="ConfirmDeletion()" />
                        </td>
                        <td width="1">
                            <input type="button" id="btNewItem" value="Inserir novo item" onclick="ResetFormForInsert()" />
                        </td>
                        <td width="99%" align="right">
                            <asp:Label ID="lblMessage" runat="server" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr height="100%">
            <td>
                <table width="100%" height="100%">
                    <tr valign="top">
                        <td>
                            <iframe id="ifrGrid" src="Grid.aspx" style="width: 100%; height: 100%" frameborder="0" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
